package com.woniu.dao;

import com.woniu.domain.Course;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * @author: 刘家元  <br/>
 * Date: 2021/6/8:12:16  <br/>
 * Description:课程持久化
 */

public interface CourseDao {
    //查询所以课程
    @ApiOperation(value = "查询所以课程")
    @ApiImplicitParam(name = "courseId",value = "课程id")
    List<Course> courseQuery();

    //根据id删除
    @ApiOperation(value = "根据id删除课程")
    @ApiImplicitParam(name = "id",value = "课程id")
    int courseDelById(@Param("id")Integer id);
    //条件查询课程
    @ApiOperation(value = "条件查询课程")
    @ApiImplicitParam(name = "obj",value = "课程对象")
    List<Course> courseConditionQuery(Course obj);
    //根据id查询课程
    @ApiOperation(value = "根据id查询课程")
    @ApiImplicitParam(name = "id",value = "课程id")
    Course courseGetById(@Param("id")Integer id);


    @ApiOperation(value = "根据ids批量查询课程")
    @ApiImplicitParam(name = "cids",value = "课程id数组")
    List<Course> findCoursesByIds(String[] cids);

    @ApiOperation(value = "添加课程")
    @ApiImplicitParam(name = "course",value = "课程对象")
    int addCourse(Course course);

    @ApiOperation(value = "修改课程")
    @ApiImplicitParam(name = "course",value = "课程对象")
    int updateCourse(Course course);

    @ApiOperation(value = "根据课程名查询课程")
    @ApiImplicitParam(name = "course",value = "课程对象")
    Course getByCourseName(@Param("courseName") String courseName);


    @ApiOperation(value = "根据课程id查询课程")
    @ApiImplicitParam(name = "id",value = "课程id")
    Course getByCourseId(@Param("courseId")Integer courseId);

    @ApiOperation(value = "根据课程id集合查询课程")
    @ApiImplicitParam(name = "courseIds",value = "课程id集合")
    List<Course> batchQueryCourseId(List<String> courseIds);

}
